package com.blctek.cryptoserver.controller;

import com.blctek.cryptoserver.utils.SecretUtils;
import com.blctek.cryptoserver.vo.VoUser;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 吴青珂
 * @Date: 2021/03/27/21:23
 * @Description:
 */
@RestController
@RequestMapping("/user")
@CrossOrigin("*")
public class UserController {
    @PostMapping("/insertUser")
    public Map<String,Object> insertUser(@RequestBody VoUser voUser){
        String password = voUser.getPassword();
        System.out.println("密文："+password);
//        System.out.println("明文："+SecretUtils);
        String decryptPassword = SecretUtils.decrypt(password);
        System.out.println("明文："+decryptPassword);
        HashMap<String, Object> resMap = new HashMap<>();
        resMap.put("message","输入密码");
        resMap.put("code",20000);
        resMap.put("data",true);
        return resMap;
    }
}
